<?php


function _phptemplate_variables($hook, $vars) {
  $css = drupal_add_css(); 

  // removing all Drupal css styling
  
  unset($css['all']['module']['modules/system/system.css']);
  unset($css['all']['module']['modules/system/defaults.css']);
  unset($css['all']['module']['modules/devel/devel.css']);
  unset($css['all']['module']['modules/aggregator/aggregator.css']);
  unset($css['all']['module']['modules/book/book.css']);
  unset($css['all']['module']['modules/node/node.css']);
  unset($css['all']['module']['modules/poll/poll.css']);
  unset($css['all']['module']['modules/user/user.css']);

  // Temporarily removing trip module(s) styling as well
  
  unset($css['all']['module']['modules/trip_destination/trip_destination.css']);
 	
  $vars['styles'] = drupal_get_css($css);
  return $vars;
}


function phptemplate_breadcrumb($breadcrumb) {                                      

  foreach ($breadcrumb as $item) {                                                
    if (is_array($item)) {                                                        
      $crumbs_output .= theme('breadcrumb', $item);                               
    } else {                                                                      
      $crumbs[] = $item;                                                          
    }                                                                             
  }                                                                               
 return $crumbs ? '<div class="breadcrumb">'. implode($crumbs, ' &raquo; ') .'</div>' : '<div class="breadcrumbs">'. $crumbs_output .'</div>';
}


function phptemplate_status_messages($display = NULL) {
  $output = '';
  foreach (drupal_get_messages($display) as $type => $messages) {
   if ($type == 'status') $type = 'notice';
   $output .= "<div class=\"messages $type\">\n";
    if (count($messages) > 1) {
      $output .= " <ul>\n";
      foreach ($messages as $message) {
        $output .= '  <li>'. $message ."</li>\n";
      }
      $output .= " </ul>\n";
    }
    else {
      $output .= $messages[0];
    }
    $output .= "</div>\n";
  }
  return $output;
}
